package com.itheima.d6_singleInstance;

public class Wife {
    private String name;
    //2.提供一个当前类型的类变量
    private static Wife wife ;
    //1.私有化构造器

    private Wife() {
        name = "樊凯";
    }
    public static Wife getInstance(){
        if(wife == null){
             wife = new Wife();
        }
        return wife;
    }
    public void show(){
        System.out.println("我的老婆是：" + name);
    }

}
